import {IPageResponse, IParam, IResponse} from "@/common/common";
import request from "@/common/request";

/**获取日志页面数据 */
export async function apiGetJournal(params: any): Promise<IPageResponse<any>> {
  console.log(JSON.stringify(params))
  return request({
    url: `/v1/app/operateLog`,
    method: "GET",
    params,
  });
}

/**获取数据导出也页面数据 */
export async function apiGetDataExport(params: any): Promise<IPageResponse<any>> {
  return request({
    url: `/v1/app/export`,
    method: "GET",
    params,
  });
}

/**获取日志页面数据 */
export async function apiDelDataExportItem(data: any): Promise<IPageResponse<any>> {
  return request({
    url: `/v1/app/export`,
    method: "DELETE",
    data,
  });
}

export async function apiGetAlarmList(params: IParam): Promise<IPageResponse<any>> {
  console.log(params)
  return request({url: `/v1/app/systemAlarm`, params});
}

export async function apiDeleteAlarmList(data: number[]): Promise<IResponse> {
  console.log(data)
  return request({url: `/v1/app/systemAlarm`, method: "DELETE", data});
}

export async function apiHandleAlarmList(data: number[]): Promise<IResponse> {
  return request({
    url: `/v1/app/system/alarm/handle`,
    method: "PUT",
    params: {handleStatus: 1},
    data: {ids: data},
  });
}

